import Vue from 'vue'
import VueRouter from 'vue-router'
import Student from '@/components/Student.vue'
import StudentAdd from '@/components/StudentAdd.vue'
import StudentList from '@/components/StudentList.vue'
import classroomRouter from './classroom'
// 使用VueRouter
Vue.use(VueRouter)

// 创建VueRouter对象
const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/student' },
    {
      path: '/student',
      component: Student,
      children: [
        { path: '', component: StudentList },
        { path: 'add', component: StudentAdd },
        { path: 'list', component: StudentList }
      ]
    },
    classroomRouter

  ]
})

// 导出router对象
export default router
